<?php
App::import('Sanitize');
class DesignsController extends AppController {

	var $name = 'Designs';

	function index($id = null) {
		$designs = $this->Design->get_designs($id);
		$this->set('designs', $designs);
	}

	function view($id = null) {
		if (!$id) {
			$this->Session->setFlash(__('Dit is geen geldig Design, probeer het nog een keer.', true));
			$this->redirect(array('action' => 'index'));
		}
		$design = Sanitize::clean($this->Design->get_design($id), array('encode' => false));
		$this->set('design', $design);
	}
}
?>
